#!/bin/sh

commitId=$(git rev-parse --short HEAD)
DATE_STR=$(date '+%y%m%d-%H%M')-${commitId}
APP_NAME=springcloud-alibaba-front
IMAGE_TAG=${APP_NAME}:${DATE_STR}

echo $IMAGE_TAG

rm -rf dist

yarn build

cp ./nginx-web.conf ./dist

docker build -f ./Dockerfile -t ${IMAGE_TAG} ./dist

docker run -d -p 8083:80 --name alibaba-front $IMAGE_TAG

docker exec -it alibaba-front sh
